'use strict';
const db = uniCloud.database()
const dbCmd = db.command
exports.main = async (event, context) => {
	//event为客户端上传的参数
	console.log('event : ', event)
	const collection = db.collection('user') // 获取表'unicloud-test'的集合对象
	const res = await collection.where({
		username:dbCmd.eq(event.username)
	}).limit(10).get() // 获取表中的10条数据，结果为json格式
	//返回数据给客户端
	return res
};
